import { connect } from 'react-redux';
import { goBack } from 'react-router-redux';
import reportFivehealthhabit from '../components/report-fivehealthhabit'
import { calcRiskOfFiveHealthHabit } from '../actions/CalcRiskAction';

const mapStateToProps = (state, ownProps) => ({
  inputData: state.report.fiveHealthHabit.inputData,
  fiveHealtHabitFlgs: state.report.fiveHealthHabit.fiveHealtHabitFlgs,
  risk: state.report.fiveHealthHabit.risk,
  initialRisk: state.report.fiveHealthHabit.initialRisk,
  advice: state.report.fiveHealthHabit.initialAdvice,
});

const mapDispatchToProps = (dispatch) => ({
  onCalcRisk: (data, fiveHealtHabitFlgs) => dispatch(calcRiskOfFiveHealthHabit(data, false ,fiveHealtHabitFlgs)),
  onCancel: () => dispatch(goBack()),
});

export default connect(mapStateToProps, mapDispatchToProps)(reportFivehealthhabit)
